package com.link_with_health.service;

import com.link_with_health.exception.BaseException;
import com.link_with_health.model.DepartmentsEntity;

import java.util.List;
public interface DepartmentsService {

    /**
     * 通过id获取科室信息
     * @param departmentId 科室id
     * @return 返回科室信息
     * @throws BaseException 异常
     */
    DepartmentsEntity getDepartById(Long departmentId) throws BaseException;

    /**
     * 获取主科室信息
     * @return 主科室信息
     * @throws BaseException 异常
     */
    List<DepartmentsEntity> getMainDepartments() throws BaseException;

    /**
     * 通过上级科室id获取其下的分支科室
     * @param parentDepart 上级科室id
     * @return 分支科室信息
     * @throws BaseException 异常
     */
    List<DepartmentsEntity> getDepartByParentDepart(int parentDepart) throws BaseException;

    /**
     * 获取所有科室信息
     * @return 科室信息
     * @throws BaseException 异常
     */
    List<DepartmentsEntity> getAllDepartments() throws BaseException;

    //
    DepartmentsEntity getDepartByNameExact(String name) throws BaseException;

    /**
     * 增加科室信息
     * @param department 科室信息
     * @return 改动数量
     * @throws BaseException 异常
     */
    int addDepartment(DepartmentsEntity department) throws BaseException;

    /**
     * 更改科室信息
     * @param department 科室信息
     * @return 改动数量
     * @throws BaseException 异常
     */
    int changeDepartment(DepartmentsEntity department) throws BaseException;

    /**
     * 删除科室信息
     * @param departmentId 科室id
     * @return
     * @throws BaseException 异常
     */
    int deleteDepartment(Long departmentId) throws BaseException;
}
